//
//  Utils.h
//  beautyAccompany
//
//  Created by xiaocankeji on 15/11/3.
//  Copyright © 2015年 xiaocankeji. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "UIImage+Color.h"
@interface Utils : NSObject
@property (strong, nonatomic) UIView *viewPrompt;

//图片上传前进行的压缩处理,不改变大小比例,尽量压缩到尺寸maximum,最大的宽或高
+(UIImage *)imageWithCompressImage:(UIImage *)image maximum:(NSInteger)maximum;
//图片的等比裁剪,显示的时候需要的
+ (UIImage*)imageWithImageSimple:(UIImage*)image scaledToSize:(CGSize)toSize;


/**
 *  //发送透传消息
 *
 *  @return dic 里面key 对应value(string)
 */

+(void)sendCmdMessageCmd:(NSString *)cmd cmdUserObjectId:(NSString *)cmdUserObjectId  ContentDic:(NSDictionary *)dic;

//向plist文件中添加新的存储(存储的都是字典)
+ (void)AddToPlistWithPlistName:(NSString *)plistName andDictionary:(NSDictionary *) dic;
//获取plist文件存储的字典
+ (NSDictionary *)plistName:(NSString *)plistName;

//保存聊过天的用户名字,头像
+(void)saveChatUserDataNicknameUser:(MPUser *)user;
//获取聊过天的用户名字,头像
+ (NSDictionary *)getChatUserNicknameHeadurlDic;
//根据用户id获取单个用户的信息
+ (NSDictionary *)getUserNicknameHeadurlObjectId:(NSString *)objectId;
//是聊过天的用户则更新用户保存的资料
+ (BOOL)isChatUserUpdateUserDataNicknameUser:(MPUser *)user;

+(void)alert:(NSString *)msg;

//默认背景
-(void)viewControllerPrompt:(CGRect)rect Text:(NSString*)text Image:(UIImage*)image;


///移动动画
+ (void)animationMobileTimer:(CGFloat )timer View:(UIView*)view Rect:(CGRect)rect;


///弹性动画
+ (void)animationSpringBounciness:(CGFloat )bounciness View:(UIView*)view Rect:(CGRect)rect;
+ (void)saveToDefaults:(id)obj forKey:(NSString*)key;
+ (id)defaultsForKey:(NSString *)key;
//退出账号
//一些全局操作
+ (void)quitLogin;
+(CGSize)LabeSizeText:(NSString*)text Font:(UIFont*)font;

+(void)pushTabbarHidden:(UIViewController*)viewController Selfvc:(UIViewController*)selfvc;

+(UIView *)Hidden :(UIView*)View Bool:(BOOL)bool2;
+(void)loginVC:(UIViewController*)vc;

+(BOOL)userinit:(UIViewController*)vc;

@end
